import { role } from "@/api";

const state = {
    roleList: [], //角色列表
    total: ''//总条数
}
const mutations = {
    GET_ROLELIST(state, role) {
        state.roleList = role.items
        state.total = role.total
    }
}
const actions = {
    async getRoleList({ commit },{page,limit,searchInput}) {
        // console.log(page,limit,searchInput,'store');
        let result = await role.getPageList(page,limit,searchInput)
        commit('GET_ROLELIST',result.data)
        // console.log(result);
    }
}
const getters = {}
export default {
    state, mutations, actions, getters
}